﻿Imports System.Collections
Imports System.Data
Imports System.Data.SqlClient

Public Class TDATA
    Public UNITCODE As String = ""   '单位编码
    Public DATAKJND As Integer = 0   '会计年度
    Public DATAKJQJ As Integer = 0   '会计期间
    Public DATAMONY As Double = 0    '金额

    Public Shared Function GetHashTabl(ByVal aSQLDataReader As SqlDataReader) As Hashtable

        Dim HashTabl As New Hashtable

        Do While aSQLDataReader.Read

            Dim DataObjt As New TDATA
            DataObjt.UNITCODE = aSQLDataReader.GetString(aSQLDataReader.GetOrdinal("DW_SCode"))
            DataObjt.DATAKJND = aSQLDataReader.GetInt32(aSQLDataReader.GetOrdinal("KJND"))
            DataObjt.DATAKJQJ = aSQLDataReader.GetInt32(aSQLDataReader.GetOrdinal("KJQJ"))

            If Not aSQLDataReader.IsDBNull(aSQLDataReader.GetOrdinal("JE")) Then
                DataObjt.DATAMONY = aSQLDataReader.GetDecimal(aSQLDataReader.GetOrdinal("JE"))
            End If

            If Not HashTabl.ContainsKey(DataObjt.UNITCODE) Then
                HashTabl.Add(DataObjt.UNITCODE, DataObjt)
            End If
        Loop

        Return HashTabl

    End Function
End Class
